const dbService = require('../service/dbService');
class CommentController {
  async createOrReplyComment(ctx) {
    const { content, moment_id, comment_id } = ctx.request.body;
    const result = await dbService.insert(
      {
        content,
        moment_id,
        comment_id,
        user_id: ctx.user.id,
      },
      'comment'
    );
    if (result && result.insertId) {
      ctx.makeResp({});
    }
  }
}

module.exports = new CommentController();
